const mqtt = require('mqtt');
const config = require('../config/mqtt.config');

const client = mqtt.connect(config.broker, config.options);

client.on('connect', () => {
  console.log('MQTT客户端已连接');
});

client.on('error', (err) => {
  console.error('MQTT连接错误:', err);
});

module.exports = client;